package com.echo.util;

import java.io.IOException;
import java.util.Map.Entry;
import java.util.Properties;

public class PropertiesUtil {
	
	public static String ACTION_PROPERTIES = "actions.properties";
	
	public static Properties loadProperties(String filename){
		Properties prop = new Properties();
		try {
			prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(filename));
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return prop;
	}
	
	public static void main(String[] args) {
		Properties prop = PropertiesUtil.loadProperties(ACTION_PROPERTIES);
		for (Entry<Object, Object> entry : prop.entrySet()) {
			System.out.println(entry.getKey() + ":" + entry.getValue());
		}
	}
}
